package com.ysuedu.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;

public class SetCode {
    public static void setEncoding(HttpServletRequest request,HttpServletResponse response) throws UnsupportedEncodingException {
        //输入，请求乱码
        request.setCharacterEncoding("utf-8");
        //输出 响应 乱码
        response.setContentType("text/html;charset=UTF-8");
        response.setCharacterEncoding("utf-8");
    }
}
